
const Dept = require('../models/Dept.js');

Dept.findAll()
.then( rows => rows.map( row => row.dataValues ) )
.then( depts => {
    depts.forEach( (d,i) => {
        console.log( i , d );
    });
    console.log( '- '.repeat(20) );
});

Dept.findByPk(1)
.then( row => row.dataValues )
.then( dept => console.log( dept ) );

Dept.findOne({
    where: {
        name: '开发部'
    }
}).then( one => {
    console.log( one );
    return one.dataValues;
}).then( dept => console.log( dept ) );